package com.jzlin.funhub.admin.model.dto;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jzlin.funhub.admin.model.entity.Article;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 * 博客文章表
 * </p>
 *
 * @author jzlin
 * @since 2025-07-15
 */
@Data
public class ArticleRecentDTO {
    /**
     * 文章ID
     */
    private String id;

    /**
     * 文章标题
     */
    private String title;

    /**
     * 文章封面图片URL
     */
    private String coverImage;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date publishedTime;

    public ArticleRecentDTO(Article article) {
        BeanUtil.copyProperties(article, this);
    }
}
